package com.topcheer.common.auth.feign;

import com.topcheer.common.api.base.vo.BaseUser;
import com.topcheer.common.auth.config.FeignConfiguration;
import com.topcheer.common.auth.user.JwtUser;
import com.topcheer.common.base.vo.BaseResponse;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.PostMapping;

/**
 * @author xutao
 * @Package com.topcheer.common.auth.feign
 * @Description: ${todo}
 * @date 2020/4/7 21:36
 */
@FeignClient(value = "cloud-provider-rbac",configuration = FeignConfiguration.class)
public interface RbacService {

    @GetMapping(value = "/user/baseUser/{loginName}")
    BaseResponse<JwtUser> getJwtUser(@PathVariable("loginName") String loginName);

    @GetMapping("/role/permission/{loginName}")
    BaseResponse<BaseUser> permission(@PathVariable("loginName") String loginName);

    @PostMapping(value = "/client/userPubKey")
    BaseResponse<byte[]> getUserPubKey();
}
